package org.southyin.aop;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;

@Component
public class AopTest {
    public void test1(){
        System.out.println("test1");
    }

    public void test2(){
        System.out.println("test2");
//        int i = 5 / 0;
    }

    public void test3(){
        System.out.println("test3");
    }

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        AopTest aopTest = context.getBean("aopTest", AopTest.class);
        aopTest.test1();
        aopTest.test2();
        aopTest.test3();
    }
}
